using UnityEngine;

public class LoadOnEnableTexture : MonoBehaviour
{
	public UITexture curTexture;

	public string nameTextureForLoad = string.Empty;

	private void Awake()
	{
		if (curTexture == null)
		{
			curTexture = GetComponent<UITexture>();
		}
	}

	private void OnEnable()
	{
		if (curTexture != null)
		{
			Texture texture = Resources.Load<Texture>("TextureForPreload/" + nameTextureForLoad);
			if (texture != null)
			{
				curTexture.mainTexture = texture;
			}
		}
	}

	private void OnDisable()
	{
	}
}
